package com.yangsir.mysite.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.yangsir.mysite.pojo.Visitcount;
import org.apache.ibatis.annotations.Select;

import java.time.LocalDate;
import java.util.List;

/**
* @author yf
* @description 针对表【visitcount(记录网站的每日访问量)】的数据库操作Mapper
* @createDate 2024-07-27 19:56:31
* @Entity com.yangsir.mysite.pojo.Visitcount
*/
public interface VisitcountMapper extends BaseMapper<Visitcount> {
    @Select("SELECT * " +
            "FROM visitcount " +
            "WHERE create_time >= TIMESTAMP(CURDATE() - INTERVAL 7 DAY, 0) " +
            "  AND create_time < TIMESTAMP(CURDATE() + INTERVAL 1 DAY, 0)")
    List<Visitcount> SevenDaysVisitCount();

    @Select("SELECT SUM(v_count) FROM visitcount WHERE (create_time NOT LIKE '2024-08-02');")
    Integer getAllVisitCount(LocalDate localDate);
}




